package com.medusa.aps.business.modules.modeling.mp.entity;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.*;
import com.medusa.aps.business.model.BaseEntity;
import com.medusa.aps.business.model.constant.RegexPool;
import com.medusa.aps.business.model.enums.AuxiliaryEnum;
import com.medusa.aps.business.model.enums.AuxiliaryStatus;
import com.medusa.aps.business.model.enums.SourceEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 辅助资源实体类
 *
 * @author yuxh
 * @since 2023-08-14 17:37:40
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class AuxiliaryData extends BaseEntity<AuxiliaryData> {
    /**
     * 主键
     */
    @Schema(description = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 辅助资源编码
     */
    @Alias(value = "辅助资源编码")
    @Schema(description = "辅助资源编码")
    @Size(max = 50, message = "辅助资源编码长度不能超过50")
    @Pattern(regexp = RegexPool.ORDER_NO, message = "辅助资源编码只支持数字、字母、符号")
    private String auxiliaryResourceCoding;

    /**
     * 辅助资源名称
     */
    @Alias(value = "辅助资源名称")
    @Schema(description = "辅助资源名称")
    @Size(max = 50, message = "辅助资源名称长度不能超过50")
    private String auxiliaryResourceName;


    /**
     * 类型
     */
    @Alias(value = "类型")
    @Schema(description = "类型")
    private AuxiliaryEnum type;

    /**
     * 状态
     */
    @Alias(value = "状态")
    @Schema(description = "状态")
    private AuxiliaryStatus status;
    /**
     * 数据来源
     */
    @Schema(description = "数据来源")
    private SourceEnum dataSource;
    /**
     * 创建人
     */
    @Schema(description = "创建人")
    @TableField(fill = FieldFill.INSERT)
    private String creator;
    /**
     * 描述
     */
    @Alias(value = "描述")
    @Schema(description = "描述")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String description;


    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    public Serializable pkVal() {
        return this.id;
    }

}

